extends ../public/layout
block title
    title 搜索
block content
    .am-g.white-background.am-padding-xs
        .am-u-sm-10
            input.am-form-field.am-input-sm.am-round.search-input.am-padding-left-sm(placeholder="输入关键字..." value="#{searchKey}" type="text")
        .am-u-sm-2.theme-color.am-text-center.am-padding-0
            button.am-btn.am-btn-sm.search-btn.white-background.theme-color(type="button") 搜索
            input(type="hidden",name="shop",id="shop",value="#{shopId}")
    if(listProduct.length)
        each product in listProduct
            .am-container.white-background.am-margin-top-sm.proList
                .am-g.pro-list-sort-content.am-padding-bottom-xs.am-padding-top-xs
                    .am-u-sm-4
                        a(href="/product/#{product.objectId}")
                            img(src="#{__IMAGE_HOST__}#{product.images}-w1h1")
                    .am-u-sm-8.am-padding-left-0
                        p.am-text-left.gray-color #{product.title}
                        span.am-block.money-color.md-font.am-text-left.md-line-height ￥#{product.price}
                        .add-cart.search-list-cart(data-productId="#{product.objectId}")
    else
        if(searchKey)
            .emptyMsg
                .empty-Search
        else
            .am-container.am-margin-top-sm
                .am-g.am-padding-sm.search-tag
            input(type="hidden" id="isFirst" value="")
            .am-g.search-clear
                .am-u-sm-12.md-font.am-text-center.removeSearchList
                    span.xs-font.theme-color 清空搜索记录

block javascript
    script(type="text/javascript" src = "/bower_components/amazeui/dist/js/amazeui.min.js")
    script(type="text/javascript" src = "/public/javascripts/search.js")
    script(type="text/javascript").
        $(function(){
            search.init();
        });

